Optimal. Leaf size=298 \[ -\frac {3}{16} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erf}\left (\frac {\sqrt [4]{-1} (2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) e^{3 i d+\frac {i b^2 \log ^2(f)}{12 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{6}} \text {Erf}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (6 i f x+b \log (f))}{\sqrt {6} \sqrt {f}}\right )-\frac {3}{16} \sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erfi}\left (\frac {\sqrt [4]{-1} (2 i f x-b \log (f))}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) e^{-\frac {1}{12} i \left (36 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{6}} \text {Erfi}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (6 i f x-b \log (f))}{\sqrt {6} \sqrt {f}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, antiderivative size = 298, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 5, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {4561, 2325,
2266, 2235, 2236} \begin {gather*} -\frac {3}{16} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{\frac {1}{4} i \left (\frac {b^2 \log ^2(f)}{f}+4 d\right )} \text {Erf}\left (\frac {\sqrt [4]{-1} (b \log (f)+2 i f x)}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) \sqrt {\frac {\pi }{6}} f^{a-\frac {1}{2}} e^{\frac {i b^2 \log ^2(f)}{12 f}+3 i d} \text {Erf}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (b \log (f)+6 i f x)}{\sqrt {6} \sqrt {f}}\right )-\frac {3}{16} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{-\frac {1}{4} i \left (\frac {b^2 \log ^2(f)}{f}+4 d\right )} \text {Erfi}\left (\frac {\sqrt [4]{-1} (-b \log (f)+2 i f x)}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) \sqrt {\frac {\pi }{6}} f^{a-\frac {1}{2}} e^{-\frac {1}{12} i \left (\frac {b^2 \log ^2(f)}{f}+36 d\right )} \text {Erfi}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (-b \log (f)+6 i f x)}{\sqrt {6} \sqrt {f}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 2325
Rule 4561
Rubi steps
\begin {align*} \int f^{a+b x} \cos ^3\left (d+f x^2\right ) \, dx &=\int \left (\frac {3}{8} e^{-i d-i f x^2} f^{a+b x}+\frac {3}{8} e^{i d+i f x^2} f^{a+b x}+\frac {1}{8} e^{-3 i d-3 i f x^2} f^{a+b x}+\frac {1}{8} e^{3 i d+3 i f x^2} f^{a+b x}\right ) \, dx\\ &=\frac {1}{8} \int e^{-3 i d-3 i f x^2} f^{a+b x} \, dx+\frac {1}{8} \int e^{3 i d+3 i f x^2} f^{a+b x} \, dx+\frac {3}{8} \int e^{-i d-i f x^2} f^{a+b x} \, dx+\frac {3}{8} \int e^{i d+i f x^2} f^{a+b x} \, dx\\ &=\frac {1}{8} \int e^{-3 i d-3 i f x^2+a \log (f)+b x \log (f)} \, dx+\frac {1}{8} \int e^{3 i d+3 i f x^2+a \log (f)+b x \log (f)} \, dx+\frac {3}{8} \int e^{-i d-i f x^2+a \log (f)+b x \log (f)} \, dx+\frac {3}{8} \int e^{i d+i f x^2+a \log (f)+b x \log (f)} \, dx\\ &=\frac {1}{8} \left (e^{3 i d+\frac {i b^2 \log ^2(f)}{12 f}} f^a\right ) \int e^{-\frac {i (6 i f x+b \log (f))^2}{12 f}} \, dx+\frac {1}{8} \left (3 e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^a\right ) \int e^{\frac {i (-2 i f x+b \log (f))^2}{4 f}} \, dx+\frac {1}{8} \left (3 e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^a\right ) \int e^{-\frac {i (2 i f x+b \log (f))^2}{4 f}} \, dx+\frac {1}{8} \left (e^{-\frac {1}{12} i \left (36 d+\frac {b^2 \log ^2(f)}{f}\right )} f^a\right ) \int e^{\frac {i (-6 i f x+b \log (f))^2}{12 f}} \, dx\\ &=-\frac {3}{16} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erf}\left (\frac {\sqrt [4]{-1} (2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) e^{3 i d+\frac {i b^2 \log ^2(f)}{12 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{6}} \text {erf}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (6 i f x+b \log (f))}{\sqrt {6} \sqrt {f}}\right )-\frac {3}{16} \sqrt [4]{-1} e^{-\frac {1}{4} i \left (4 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt [4]{-1} (2 i f x-b \log (f))}{2 \sqrt {f}}\right )-\left (\frac {1}{16}+\frac {i}{16}\right ) e^{-\frac {1}{12} i \left (36 d+\frac {b^2 \log ^2(f)}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{6}} \text {erfi}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (6 i f x-b \log (f))}{\sqrt {6} \sqrt {f}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.96, size = 267, normalized size = 0.90 \begin {gather*} \frac {1}{48} \sqrt [4]{-1} e^{-\frac {i b^2 \log ^2(f)}{4 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \left (-9 \text {Erfi}\left (\frac {(-1)^{3/4} (2 f x+i b \log (f))}{2 \sqrt {f}}\right ) (\cos (d)-i \sin (d))+9 e^{\frac {i b^2 \log ^2(f)}{2 f}} \text {Erfi}\left (\frac {\sqrt [4]{-1} (2 f x-i b \log (f))}{2 \sqrt {f}}\right ) (-i \cos (d)+\sin (d))+\sqrt {3} e^{\frac {i b^2 \log ^2(f)}{6 f}} \left (-\text {Erfi}\left (\frac {(-1)^{3/4} (6 f x+i b \log (f))}{2 \sqrt {3} \sqrt {f}}\right ) (\cos (3 d)-i \sin (3 d))+e^{\frac {i b^2 \log ^2(f)}{6 f}} \text {Erfi}\left (\frac {(6+6 i) f x+(1-i) b \log (f)}{2 \sqrt {6} \sqrt {f}}\right ) (-i \cos (3 d)+\sin (3 d))\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.60, size = 235, normalized size = 0.79
method | result | size |
risch | \(-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {i \left (\ln \left (f \right )^{2} b^{2}+36 d f \right )}{12 f}} \sqrt {3}\, \erf \left (-\sqrt {3}\, \sqrt {i f}\, x +\frac {\ln \left (f \right ) b \sqrt {3}}{6 \sqrt {i f}}\right )}{48 \sqrt {i f}}-\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {i \left (\ln \left (f \right )^{2} b^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {i f}}\right )}{16 \sqrt {i f}}-\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {i \left (\ln \left (f \right )^{2} b^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {-i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {-i f}}\right )}{16 \sqrt {-i f}}-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {i \left (\ln \left (f \right )^{2} b^{2}+36 d f \right )}{12 f}} \erf \left (-\sqrt {-3 i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {-3 i f}}\right )}{16 \sqrt {-3 i f}}\) | \(235\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 302, normalized size = 1.01 \begin {gather*} -\frac {9^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 36 \, d f}{12 \, f}\right ) + \left (i + 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 36 \, d f}{12 \, f}\right )\right )} \operatorname {erf}\left (\frac {6 i \, f x - b \log \left (f\right )}{2 \, \sqrt {3 i \, f}}\right ) + {\left (\left (i + 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 36 \, d f}{12 \, f}\right ) + \left (i - 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 36 \, d f}{12 \, f}\right )\right )} \operatorname {erf}\left (\frac {6 i \, f x + b \log \left (f\right )}{2 \, \sqrt {-3 i \, f}}\right )\right )} f^{\frac {3}{2}} - 9 \, \sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i - 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right ) - \left (i + 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {2 i \, f x - b \log \left (f\right )}{2 \, \sqrt {i \, f}}\right ) + {\left (-\left (i + 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right ) - \left (i - 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {2 i \, f x + b \log \left (f\right )}{2 \, \sqrt {-i \, f}}\right )\right )} f^{\frac {3}{2}}}{96 \, f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 525 vs. \(2 (196) = 392\).
time = 2.90, size = 525, normalized size = 1.76 \begin {gather*} \frac {\sqrt {6} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 12 \, a f \log \left (f\right ) - 36 i \, d f}{12 \, f}\right )} \operatorname {C}\left (\frac {\sqrt {6} {\left (6 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{6 \, f}\right ) - \sqrt {6} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 12 \, a f \log \left (f\right ) + 36 i \, d f}{12 \, f}\right )} \operatorname {C}\left (-\frac {\sqrt {6} {\left (6 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{6 \, f}\right ) + 9 \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) - 4 i \, d f}{4 \, f}\right )} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - 9 \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) + 4 i \, d f}{4 \, f}\right )} \operatorname {C}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - i \, \sqrt {6} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 12 \, a f \log \left (f\right ) - 36 i \, d f}{12 \, f}\right )} \operatorname {S}\left (\frac {\sqrt {6} {\left (6 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{6 \, f}\right ) - i \, \sqrt {6} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 12 \, a f \log \left (f\right ) + 36 i \, d f}{12 \, f}\right )} \operatorname {S}\left (-\frac {\sqrt {6} {\left (6 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{6 \, f}\right ) - 9 i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) - 4 i \, d f}{4 \, f}\right )} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - 9 i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 \, a f \log \left (f\right ) + 4 i \, d f}{4 \, f}\right )} \operatorname {S}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right )\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right )}{48 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x} \cos ^{3}{\left (d + f x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 595 vs. \(2 (196) = 392\).
time = 0.49, size = 595, normalized size = 2.00 \begin {gather*} -\frac {3 \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x - \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} - \frac {i \, \pi ^{2} b^{2}}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} + \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) + i \, d\right )}}{16 \, {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} - \frac {\sqrt {6} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{24} \, \sqrt {6} \sqrt {f} {\left (12 \, x - \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )}\right ) e^{\left (\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{24 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{12 \, f} - \frac {i \, \pi ^{2} b^{2}}{24 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{12 \, f} + \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{12 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) + 3 i \, d\right )}}{48 \, \sqrt {f} {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )}} - \frac {\sqrt {6} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{24} \, \sqrt {6} \sqrt {f} {\left (12 \, x + \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{24 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{12 \, f} + \frac {i \, \pi ^{2} b^{2}}{24 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{12 \, f} - \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{12 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) - 3 i \, d\right )}}{48 \, \sqrt {f} {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )}} - \frac {3 \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x + \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right )}{f}\right )} {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (-\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} + \frac {i \, \pi ^{2} b^{2}}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} - \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a + a \log \left ({\left | f \right |}\right ) - i \, d\right )}}{16 \, {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int f^{a+b\,x}\,{\cos \left (f\,x^2+d\right )}^3 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________